import sqlite3

# Connect to the SQLite database (or create it if it doesn't exist)
conn = sqlite3.connect('my_db.db')

# Create a cursor object
c = conn.cursor()

# Create the 'user' table
c.execute('''
    CREATE TABLE user (
        user_id INTEGER PRIMARY KEY,
        user_name VARCHAR(20),
        department_id INTEGER,
        performance_id INTEGER
    )
''')

# Create the 'department' table
c.execute('''
    CREATE TABLE department (
        department_id INTEGER PRIMARY KEY,
        department_name VARCHAR(20)
    )
''')

# Create the 'performance' table
c.execute('''
    CREATE TABLE performance (
        performance_id INTEGER PRIMARY KEY,
        weekly_performance INTEGER,
        monthly_performance INTEGER,
        yearly_performance INTEGER
    )
''')

# Insert three rows into the 'user' table
c.execute("INSERT INTO user (user_id, user_name, department_id, performance_id) VALUES (1, 'User1', 1, 1)")
c.execute("INSERT INTO user (user_id, user_name, department_id, performance_id) VALUES (2, 'User2', 2, 2)")
c.execute("INSERT INTO user (user_id, user_name, department_id, performance_id) VALUES (3, 'User3', 3, 3)")

# Insert three rows into the 'department' table
c.execute("INSERT INTO department (department_id, department_name) VALUES (1, 'Department1')")
c.execute("INSERT INTO department (department_id, department_name) VALUES (2, 'Department2')")
c.execute("INSERT INTO department (department_id, department_name) VALUES (3, 'Department3')")

# Insert three rows into the 'performance' table
c.execute("INSERT INTO performance (performance_id, weekly_performance, monthly_performance, yearly_performance) VALUES (1, 100, 400, 5000)")
c.execute("INSERT INTO performance (performance_id, weekly_performance, monthly_performance, yearly_performance) VALUES (2, 200, 800, 10000)")
c.execute("INSERT INTO performance (performance_id, weekly_performance, monthly_performance, yearly_performance) VALUES (3, 300, 1200, 15000)")

# Commit the changes and close the connection
conn.commit()
conn.close()
